package cn.hesion.Proxy.Dynamicproxy.DynamicDataBaseProxy;

import cn.hesion.Proxy.StaticProxy.DataBaseProxy.IOrderService;
import cn.hesion.Proxy.StaticProxy.DataBaseProxy.Order;
import cn.hesion.Proxy.StaticProxy.DataBaseProxy.OrderService;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Client {
    public static void main(String[] args) {
        try {
            Order order = new Order();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
            Date date = sdf.parse("2020/4/25");
            order.setCreateTime(date.getTime());

            IOrderService orderService = (IOrderService) new DataSourceDynamticFactory().getInstance(new OrderService());
            orderService.createOrder(order);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
